package com.mvity.framework.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.mvity.framework.common.base.BaseEntity;

/**
 * 用户账户表
 * 
 * @author vity
 * @date 2012-5-10
 * @mail vity.1215@gmail.com
 */
@Entity
@Table(name = "system_user_account")
public class SystemUserAccount extends BaseEntity {

	private static final long serialVersionUID = -7522940589917069156L;

	/**
	 * 关联用户信息对象ID
	 */
	@Column(name = "user_id", length = 32, nullable = false, updatable = false)
	private String userId;

	/**
	 * 登陆用户名
	 */
	@Column(name = "login_name", length = 50, nullable = false, unique = true, updatable = false)
	private String loginName;

	/**
	 * 登陆密码
	 */
	@Column(name = "user_password", length = 255, nullable = false)
	private String userPassword;

	/**
	 * 注册邮箱(也可以作为登录名使用)
	 */
	@Column(name = "register_email", length = 255, nullable = false, updatable = false, unique = true)
	private String registerEmail;

	/**
	 * 注册IP
	 */
	@Column(name = "register_ip", length = 200, nullable = false, updatable = false)
	private String registerIP;

	/**
	 * 最进登陆时间
	 */
	@Column(name = "last_login_time", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastLoginTime;

	/**
	 * 最近登陆IP
	 */
	@Column(name = "last_login_ip", length = 200, nullable = false)
	private String lastLoginIP;

	/**
	 * 登陆次数合计
	 */
	@Column(name = "login_count", nullable = false)
	private int loginCount;

	/**
	 * 错误登陆次数合计
	 */
	@Column(name = "error_login_count", nullable = false)
	private int errorLoginCount;

	/**
	 * 最近一次错误登陆时间
	 */
	@Column(name = "error_login_time", nullable = true)
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastErrorLoginTime;

	/**
	 * 最近一次错误登陆IP
	 */
	@Column(name = "error_login_ip", length = 200, nullable = false)
	private String lastErrorLoginIp;

	/**
	 * 最近一次帐户锁定时间
	 */
	@Column(name = "locked_time", nullable = true)
	@Temporal(TemporalType.TIMESTAMP)
	private Date lockedTime;

	/**
	 * 返回 userId 的值
	 * 
	 * @return userId
	 */
	public String getUserId() {
		return userId;
	}

	/**
	 * 设置 userId 的值
	 * 
	 * @param userId
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}

	/**
	 * 返回 loginName 的值
	 * 
	 * @return loginName
	 */
	public String getLoginName() {
		return loginName;
	}

	/**
	 * 设置 loginName 的值
	 * 
	 * @param loginName
	 */
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	/**
	 * 返回 userPassword 的值
	 * 
	 * @return userPassword
	 */
	public String getUserPassword() {
		return userPassword;
	}

	/**
	 * 设置 userPassword 的值
	 * 
	 * @param userPassword
	 */
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	/**
	 * 返回 registerEmail 的值
	 * 
	 * @return registerEmail
	 */
	public String getRegisterEmail() {
		return registerEmail;
	}

	/**
	 * 设置 registerEmail 的值
	 * 
	 * @param registerEmail
	 */
	public void setRegisterEmail(String registerEmail) {
		this.registerEmail = registerEmail;
	}

	/**
	 * 返回 registerIP 的值
	 * 
	 * @return registerIP
	 */
	public String getRegisterIP() {
		return registerIP;
	}

	/**
	 * 设置 registerIP 的值
	 * 
	 * @param registerIP
	 */
	public void setRegisterIP(String registerIP) {
		this.registerIP = registerIP;
	}

	/**
	 * @return the lastLoginTime
	 */
	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	/**
	 * @param lastLoginTime
	 *            the lastLoginTime to set
	 */
	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	/**
	 * 返回 lastLoginIP 的值
	 * 
	 * @return lastLoginIP
	 */
	public String getLastLoginIP() {
		return lastLoginIP;
	}

	/**
	 * 设置 lastLoginIP 的值
	 * 
	 * @param lastLoginIP
	 */
	public void setLastLoginIP(String lastLoginIP) {
		this.lastLoginIP = lastLoginIP;
	}

	/**
	 * 返回 loginCount 的值
	 * 
	 * @return loginCount
	 */
	public int getLoginCount() {
		return loginCount;
	}

	/**
	 * 设置 loginCount 的值
	 * 
	 * @param loginCount
	 */
	public void setLoginCount(int loginCount) {
		this.loginCount = loginCount;
	}

	/**
	 * 返回 errorLoginCount 的值
	 * 
	 * @return errorLoginCount
	 */
	public int getErrorLoginCount() {
		return errorLoginCount;
	}

	/**
	 * 设置 errorLoginCount 的值
	 * 
	 * @param errorLoginCount
	 */
	public void setErrorLoginCount(int errorLoginCount) {
		this.errorLoginCount = errorLoginCount;
	}

	/**
	 * 返回 lastErrorLoginTime 的值
	 * 
	 * @return lastErrorLoginTime
	 */
	public Date getLastErrorLoginTime() {
		return lastErrorLoginTime;
	}

	/**
	 * 设置 lastErrorLoginTime 的值
	 * 
	 * @param lastErrorLoginTime
	 */
	public void setLastErrorLoginTime(Date lastErrorLoginTime) {
		this.lastErrorLoginTime = lastErrorLoginTime;
	}

	/**
	 * 返回 lastErrorLoginIp 的值
	 * 
	 * @return lastErrorLoginIp
	 */
	public String getLastErrorLoginIp() {
		return lastErrorLoginIp;
	}

	/**
	 * 设置 lastErrorLoginIp 的值
	 * 
	 * @param lastErrorLoginIp
	 */
	public void setLastErrorLoginIp(String lastErrorLoginIp) {
		this.lastErrorLoginIp = lastErrorLoginIp;
	}

	/**
	 * 返回 lockedTime 的值
	 * 
	 * @return lockedTime
	 */
	public Date getLockedTime() {
		return lockedTime;
	}

	/**
	 * 设置 lockedTime 的值
	 * 
	 * @param lockedTime
	 */
	public void setLockedTime(Date lockedTime) {
		this.lockedTime = lockedTime;
	}

}
